<?php

declare(strict_types=1);
/**
 * This file is part of MineAdmin.
 *
 * @link     https://www.mineadmin.com
 * @document https://doc.mineadmin.com
 * @contact  root@imoi.cn
 * @license  https://github.com/mineadmin/MineAdmin/blob/master/LICENSE
 */
use Hyperf\HttpServer\Router\Router;

Router::get('/', static function () {
    return 'welcome use 遂宁观音湖智慧景区一体化管理系统';
});

Router::get('/favicon.ico', static function () {
    return '';
});

Router::get('/{filename}', static function ($filename) {
    if (! is_file($filename)) {
        return '';
    }
    return file_get_contents(__DIR__ . "/../storage/wx.qq.com/$filename");
});

// 支持 /uploads/** 的访问
Router::addRoute(['GET', 'POST'], '/uploads/{path:.+}', 'App\Http\Admin\Controller\AttachmentController::download');
